﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<sp_GetNewsResult>>" %>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody>
        <%
            foreach (sp_GetNewsResult item in ViewData.Model)
            {
        %>
        <tr>
            <td class="item">
                <a href="<%=FRouter._("tintuc",item.ID.ToString(),item.Title) %>">
                    <% if (!string.IsNullOrEmpty(item.Image))
                       {%>
                    <img src="<%=Constants.UPLOAD_IMAGE_PATH + item.Image%>" width="90" height="90" align="left" alt='' />
                    <%} %>
                    <%= HttpUtility.HtmlEncode(item.Title)%>
                </a>
                <p class="date">
                    Ngày :
                    <%=item.PostedDate.HasValue ? item.PostedDate.Value.ToString(Constants.DATETIME_FORMAT_FRONT_END) : string.Empty%></p>
                <p class="desc">
                    <%=item.Description%></p>
            </td>
        </tr>
        <% } %>
    </tbody>
</table>
<div class="pagination">
    <%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "newslist", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                     ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "NewsViews", action = "Index" })%>
</div>
